Skip to content

[Feat] 트래킹 모니터링 시스템 구축 (Actuator + Prometheus + 구조화 로깅)#161

Merged
howooyeon merged 8 commits into
developfrom
feat/#144-tracking-monitoring
May 29, 2026
Merged

[Feat] 트래킹 모니터링 시스템 구축 (Actuator + Prometheus + 구조화 로깅)#161
howooyeon merged 8 commits into
developfrom
feat/#144-tracking-monitoring

Conversation

@howooyeon

@howooyeon howooyeon commented May 29, 2026

Copy link
Copy Markdown
Contributor

🧾 요약

  • 실시간 트래킹 현장 테스트를 위한 모니터링 인프라 구축 (Actuator + Prometheus + MDC 기반 구조화 로깅)

🔗 이슈

✨ 변경 내용

  • Actuator + Prometheus 의존성 추가, 메트릭 엔드포인트 활성화 (별도 포트 9090 분리)
  • Management 포트용 SecurityFilterChain 추가 (EndpointRequest 기반 permitAll)
  • logback-spring.xml 추가 — local: 텍스트, prod: JSON(LogstashEncoder) + Loki 연동 대비
  • JwtFilter / TrackingGpsPublisher / TrackingStreamConsumer에 MDC sessionId·userId 세팅
  • 트래킹 핵심 로그 INFO 레벨 강화 및 [TAG] 설명 | key=value 가독성 포맷 통일
  • 보안 수정: Actuator 별도 포트 분리, GPS 좌표 로그 노출 제거, MDC.clear() → MDC.remove() 변경

✅ 확인

  • 빌드 OK
  • 테스트 OK (현장 등산 테스트 예정)

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 03110a00-a64c-4b15-a346-f4909f85ff33

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#144-tracking-monitoring

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a robust monitoring and observability infrastructure for the real-time tracking system. By integrating Actuator and Prometheus, the team can now monitor system health and performance metrics. Furthermore, the introduction of structured JSON logging and MDC-based context tracking significantly improves the ability to debug and trace user sessions across the application's asynchronous processing flows.

Highlights

  • Infrastructure Setup: Integrated Spring Boot Actuator and Prometheus for real-time monitoring, exposing metrics on a dedicated port (9090).
  • Structured Logging: Added Logback configuration with LogstashEncoder for JSON-formatted logs in production, enabling better observability with Loki.
  • MDC Context Management: Implemented MDC (Mapped Diagnostic Context) across JwtFilter, TrackingGpsPublisher, and TrackingStreamConsumer to trace user and session activity.
  • Logging Improvements: Standardized log formats and elevated key tracking events to INFO level while ensuring sensitive GPS data is excluded from logs.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@howooyeon
howooyeon merged commit ee6de45 into develop May 29, 2026
3 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates Spring Boot Actuator, Micrometer Prometheus, and Logstash Logback Encoder to enable structured JSON logging and metrics collection. It also configures MDC to track 'userId' and 'sessionId' across filters, publishers, and consumers. The review feedback suggests revising the MDC key filtering in 'logback-spring.xml' to prevent potential issues with future distributed tracing integrations.

Comment on lines +18 to +22
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<includeMdcKeyName>sessionId</includeMdcKeyName>
<includeMdcKeyName>userId</includeMdcKeyName>
<timeZone>Asia/Seoul</timeZone>
</encoder>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

[P3] MDC 키 필터링 방식 검토 (향후 분산 추적 연동 고려)

현재 LogstashEncoder 설정에서 <includeMdcKeyName>을 사용하여 sessionIduserId만 MDC에서 포함하도록 필터링하고 있습니다.
이 방식은 로그를 깔끔하게 유지하는 데 도움이 되지만, 향후 Spring Cloud SleuthMicrometer Tracing 등을 도입하여 분산 추적(traceId, spanId 등)을 로그에 포함하고자 할 때, 해당 MDC 키들이 누락되는 문제가 발생할 수 있습니다.

따라서 특정 MDC 키만 명시적으로 포함하기보다는, 기본적으로 모든 MDC 키를 포함하도록 하거나 제외할 키만 <excludeMdcKeyNames>로 관리하는 방식을 검토해 주세요.

References
  1. 유지보수성 및 모니터링 시스템과의 연동성을 고려하여 설정을 검토합니다. (link)

@pooreumjung pooreumjung added the enhancement New feature or request label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 트래킹 모니터링 시스템 구축 (MDC + Loki + Prometheus)

2 participants